import collections


def parse_args(data):
    data = data.split()
    opts = {}
    args = []
    for frag in data:
        if frag.startswith("--"):
            frag = frag[2:].split("=")
            opts[frag[0]] = frag[1] if len(frag) > 1 else None
        elif frag.startswith("-"):
            opts[frag[1:2]] = frag[2:] if len(frag) > 2 else None
        else:
            args.append(frag)
    return opts, args


if __name__ == "__main__":
    aaa = collections.OrderedDict()
    aaa["a"] = 1
    aaa["b"] = 2
    aaa["a"] = 3
    print(aaa)
